package com.gzbugu.bugusys.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.gzbugu.bugusys.dao.IBaseDAO;
import com.gzbugu.bugusys.vo.User;

@Service
public class LoginService {
	@Resource(name = "baseDAO")
	private IBaseDAO baseDAO;

	public boolean login(String passport, String password) {
		List temp = baseDAO.findByProperty("passport", passport,
				com.gzbugu.bugusys.fields.VoClasseFields.USER);
		if (temp.size() != 0) {
			if (((User) temp.get(0)).getPassword().equals(password)) {
				return true;
			}
		}
		return false;
	}
}
